<template>
	<div class="code">
		<view class="head">
			<image :src="head.img" mode="widthFix" @click="goback" style="width: 8%;"></image>
			<view>{{head.text}}</view>
		</view>
		<view class="codecont" style="position: relative;">
			<image src="../../static/gohead.jpg" mode="widthFix" style="position: absolute;width: 110rpx;top: 300rpx;left: 125rpx;"></image>
			<image :src="img" mode="widthFix" style="width: 750rpx;"></image>
			<image :show-menu-by-longpress="true" src="../../static/code.png" mode="widthFix"  style="position: absolute;width: 280rpx;bottom: 160rpx;left: 240rpx;"  @longtap="previewImage"></image>
		</view>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				head:{
					img:"../../static/back.png",
					text:"邀请好友"
				},
				img:"../../static/code.jpg"
			}
		},
		methods: {
			goback() {
				uni.navigateBack()
			},
			previewImage(e) {
					console.log('e', e);
					uni.previewImage({
						// 需要预览的图片链接列表
						urls: [],
						// 为当前显示图片的链接/索引值
						current: '../../static/code.png',
						// 图片指示器样式	
						indicator:'default',
						// 是否可循环预览
						loop:false,
						// 长按图片显示操作菜单，如不填默认为保存相册
						// longPressActions:{
						// 	itemList:[this.l('发送给朋友'),this.l]
						// },
						success: res => {
							console.log('res', res);
						}, 
						fail: err => {
							onsole.log('err', err);
						}
					});
			}
		}
	}
</script>

<style lang="scss">
	page{background-color: #fff;}
	*{padding: 0;margin: 0;}
	.head{background-color: #000;color: #fff;display: flex;align-items: center;padding: 10rpx 0;margin-top: 80rpx;}
</style>